/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.DepositeLogClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import com.enation.app.javashop.framework.database.WebPage;
import com.enation.app.javashop.model.member.dto.DepositeParamDTO;
import com.enation.app.javashop.model.trade.deposite.DepositeLogDO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fk
 * @version v2.0
 * @Description: 预存款记录客户端实现断路器
 * @date 2020/2/27 14:40
 * @since v7.0.0
 */
@Component
public class DepositeLogClientFallbackFactory extends BaseFallbackFactory<DepositeLogClientFeignImpl> implements FallbackFactory {

    @Override
    protected DepositeLogClientFeignImpl fallback() {
        return new DepositeLogClientFallback();
    }

    /**
     * @author fk
     * @version v2.0
     * @Description: 预存款记录客户端实现断路器
     * @date 2020/2/27 14:40
     * @since v7.0.0
     */
    @Component
    public static class DepositeLogClientFallback implements DepositeLogClientFeignImpl {

        protected final Log logger = LogFactory.getLog(this.getClass());

        @Override
        public void add(DepositeLogDO logDO) {

            logger.error("添加预存款日志出错");
        }

        @Override
        public WebPage list(DepositeParamDTO paramDTO) {
            logger.error("获取预存款日志出错");
            return null;
        }
    }
}
